import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'index',
    component: () => import('../views/Index.vue'),
    children: [
      {
        path: '/',
        name: 'home',
        component: () => import('../views/Home.vue')
      },
      {
        path: 'order',
        name: 'order',
        component: () => import('../views/Order.vue')
      },
      {
        path: 'my',
        name: 'my',
        component: () => import('../views/My.vue')
      }
    ],

  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/Login.vue')
  },
  {
    path: '/address',
    name: 'address',
    component: () => import('../views/Address.vue')
  },
  {
    path: '/search',
    name: 'search',
    component: () => import('../views/Search.vue')
  },
  {
    path: '/shop/:shopId.html',
    name: 'shopdetail',
    component: () => import('../views/ShopDetail.vue')
  },
  {
    path: '/shoplist/:shopTypeId',
    name: 'shopList',
    component: () => import('../views/ShopList.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes,
  linkActiveClass: 'is-selected'
})

export default router
